A domestic sewing machine, which carries out a buttonholing sewing, employs a buttonholing device capable of changing a length of a buttonhole to be formed in accordance with a size of a button (see, e.g., JP 3151923 B2).
As shown in FIG. 16, in a buttonholing device 100, a pressing member 101 having a pressing frame 102 slidable in a cloth feeding direction is attached to a lower end of a pressing bar. A spiral spring 103 is provided in a hollow stopper 102a fixed to an upper end surface, in a direction A, of the pressing frame 102. A starting position of the sewing is set such that the pressing member 101 abuts against the stopper 102a due to an elastic force of the spiral spring 103 which is constantly being applied thereto.
An end portion, in a direction B, of the pressing frame 102 is provided with a button holding device 104 having a holding portion 104a which is slidable in the cloth feeding direction in accordance with a size of a button to be held between a fixed holding portion 104b and the holding portion 104a. 
The pressing member 101 is provided with a potentiometer 105 extending in the cloth feeding direction on an outer side of the pressing frame 102, and the holding portion 104a is provided with a detecting portion 106 which contacts with the potentiometer 105. The potentiometer 105 includes a variable resistor. As shown in FIG. 16, when the pressing frame 102 is moved, a position in which the detecting portion 106 and the potentiometer 105 come in contact with each other is changed so that a resistance value changes. Based on a voltage value applied to the resistance thus changing, it is possible to know a displacement amount of the pressing frame 102 (i.e., a sewing length).
When a buttonholing sewing is started, the voltage value applied to the potentiometer 105 at the time of starting is stored in a memory of a control device. The control device drives a sewing machine motor and a needle swinging motor to carry out a bar tack stitching, and then, changes a swinging amount of a needle and drives a cloth feeding motor to carry out a stitching on a left side of a buttonhole. During the sewing operation, the control device decides whether the resistance value of the potentiometer is zero or not. When the control device decides that the resistance value is zero, the control device drives the sewing machine motor and the needle swinging motor to carry out another bar tack stitching, and then, changes the swinging amount of the needle and drives the cloth feeding motor to carry out a stitching on a right side of the buttonhole. The control device decides whether the resistance value of the potentiometer 105 is zero or not. When the control device decides that the resistance value is zero, the control device ends the sewing operation.
FIG. 17 shows another buttonholing device 120 in which a pressing frame 122 is provided slidably in a cloth feeding direction with respect to a pressing member 121 attached to a lower end of a pressing bar of the sewing machine. The pressing frame 122 has a rack 123 provided slidably in the cloth feeding direction. The rack 123 can be moved so as be adjusted to a scale (not shown) formed on the pressing frame 122, and can be fixed to the pressing frame 122 by fastening a knob 124 provided on the rack 123. A rotary potentiometer 126 is supported on the pressing member 121, and includes a pinion (a gear) 125 engaging with the rack 123 (see, e.g., JP 56-015784 A).
When feeding a cloth in the buttonholing device 120, the pressing frame 122 slides in a cloth feeding direction with respect to the pressing member 121 together with the cloth. The pinion 125 engaging with the rack 123 is rotated, therefore, and a moving amount of the pressing frame 122 is detected by the potentiometer 126 from a rotation amount of the pinion 125.
In addition, an error of a cloth feeding amount is detected by the potentiometer 126 in every stitch, and the cloth feeding amount is corrected in every stitch based thereon. Namely, in the buttonholing device 120, the potentiometer 126 is used to detect a target distance (i.e., a length of a buttonhole) and to detect a feeding error in every stitch.
However, in the buttonholing device 100 disclosed in JP 3151923 B2, only a reaching to a target position is monitored by the potentiometer. Thus, a reduction in a pitch from the set pitch cannot be recognized when a smooth cloth feeding is disturbed, e.g., by a step portion on a middle portion of the cloth. As a result, there is a problem that an unstableness of the pitch or a feeding jam is generated.
Further, in a circular arc section of an eyelet buttonholing sewing, the needle is located in accordance with predetermined X-Y position coordinate data. Therefore, the monitoring operation by the potentiometer is not carried out. Accordingly, there is again a problem that an unstableness of the pitch or a feeding jam is generated.
In the buttonholing device 120 disclosed in JP 56-015784 A, a feeding error is obtained in every stitch, and a feeding correction is carried out in every subsequent stitch. Therefore, it is possible to perform a correction to eliminate a pitch error in every stitch which may be caused by the generation of a feeding hindrance due to a step. However, because an error in the previous stitch is directly corrected in the subsequent stitch, the feed in the subsequent stitch is greatly influenced in a case in which an error is accidentally caused only in one stitch or in a case in which a noise is generated in the detection of the potentiometer. Thus, in some cases, a great error is generated as a result so that the sewing operation becomes unstable.